home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Internet Info 1994 March
/
Internet Info CD-ROM (Walnut Creek) (March 1994).iso
/
networking
/
ip
/
ka9q
/
src890906.arc
/
MKDEP.C
< prev
next >
Wrap
C/C++ Source or Header
|
1989-08-13
|
688b
|
37 lines
#include <stdio.h>
#include <string.h>
char include[] = "#include";
main(argc,argv)
int argc;
char *argv[];
{
int i;
FILE *fp;
char buf[512],*cp,*cp1;
for(i=1;i<argc;i++){
strcpy(buf,argv[i]);
if((cp = strchr(buf,'.')) == NULL)
continue;
*cp = '\0';
printf("%s.obj: %s",buf,argv[i]);
fp = fopen(argv[i],"r");
while(fgets(buf,512,fp) != NULL){
if(strncmp(buf,include,sizeof(include)-1) != 0)
continue;
if((cp = strchr(buf,'\"')) == NULL)
continue;
cp++;
if((cp1 = strchr(cp,'\"')) == NULL)
continue;
putchar(' ');
while(cp != cp1)
putchar(*cp++);
}
putchar('\n');
fclose(fp);
}
return 0;
}